CREATE OR REPLACE
TRIGGER PIECE_UPGRADES_TRIGGER
BEFORE INSERT ON PIECE_UPGRADES
FOR EACH ROW WHEN (NEW.PIECE_UPGRADE_ID IS NULL)
BEGIN
	SELECT PIECE_UPGRADES_SEQ.NEXTVAL
	INTO :NEW.PIECE_UPGRADE_ID
	FROM DUAL;
END;